<?php
$this->pageTitle = Yii::app()->name . ' - ' . UserModule::t("Login");
$this->breadcrumbs = array(
    UserModule::t("Login"),
);
?>

    <div class="row">
        <div class="form col-md-4">
        </div>
        <div class="form col-md-4">


            <?php
            if ( Yii::app()->user->hasFlash('loginRequired') ) {
                $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
                    'id'=>'loginrequire',
                    // additional javascript options for the dialog plugin
                    'options'=>array(
                        'title'=>'Ideality',
                    ),
                ));
            }
            ?>

            You need to register or log in to post project.

            <?php
            if ( Yii::app()->user->hasFlash('loginRequired') ) {
                $this->endWidget('zii.widgets.jui.CJuiDialog');
            }
            ?>


            <?php CHtml::$errorCss = "has-error"; ?>
            <h1><?php echo UserModule::t("Login"); ?></h1>

            <?php if (Yii::app()->user->hasFlash('loginMessage')): ?>

                <div class="success">
                    <?php echo Yii::app()->user->getFlash('loginMessage'); ?>
                </div>

            <?php endif; ?>

            <p><?php echo UserModule::t("Please fill out the following form with your login credentials:"); ?></p>

            <?php echo CHtml::beginForm(); ?>

            <p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>

            <?php echo CHtml::errorSummary($model); ?>

            <?php echo CHtml::activeLabelEx($model, 'username'); ?>
            <?php echo CHtml::activeTextField($model, 'username', array('class' => 'form-control')) ?>

            <?php echo CHtml::activeLabelEx($model, 'password'); ?>
            <?php echo CHtml::activePasswordField($model, 'password', array('class' => 'form-control')) ?>

            <p class="hint">
                <?php echo CHtml::link(UserModule::t("Register"), Yii::app()->getModule('user')->registrationUrl); ?>
                | <?php echo CHtml::link(UserModule::t("Lost Password?"), Yii::app()->getModule('user')->recoveryUrl); ?>
            </p>


            <div class="rememberMe">
                <?php echo CHtml::activeCheckBox($model, 'rememberMe'); ?>
                <?php echo CHtml::activeLabelEx($model, 'rememberMe'); ?>
            </div>

            <div class="submit">
                <?php echo CHtml::submitButton(UserModule::t("Login"), array('class' => 'btn btn-default')); ?>
            </div>

            <?php echo CHtml::endForm(); ?>
        </div>
        <!-- form -->
        <div class="form col-md-4">
        </div>
    </div>
<?php
$form = new CForm(array(
    'elements' => array(
        'username' => array(
            'type' => 'text',
            'maxlength' => 32,
        ),
        'password' => array(
            'type' => 'password',
            'maxlength' => 32,
        ),
        'rememberMe' => array(
            'type' => 'checkbox',
        )
    ),
    'buttons' => array(
        'login' => array(
            'type' => 'submit',
            'label' => 'Login',
        ),
    ),
), $model);
?>